package com.fac.dto;

import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;

import javax.validation.Valid;
import javax.validation.constraints.NotBlank;
import javax.validation.constraints.NotEmpty;
import javax.validation.constraints.NotNull;
import java.io.Serializable;
import java.util.List;

/**
 * 创建巡检计划DTO
 */
@Data
@ApiModel(description = "创建巡检计划请求参数")
public class InspectionPlanCreateDTO implements Serializable {

    @NotBlank(message = "计划名称不能为空")
    @ApiModelProperty(value = "计划名称", example = "设备日常巡检", required = true)
    private String name;

    @NotNull(message = "巡检周期不能为空")
    @ApiModelProperty(value = "巡检周期：0每天，1每周，2每月，3每季度", example = "0", required = true)
    private Integer cycle;

    @NotEmpty(message = "巡检项目不能为空")
    @Valid
    @ApiModelProperty(value = "巡检项目列表", required = true)
    private List<InspectionItem> items;

    @NotNull(message = "管理员ID不能为空")
    @ApiModelProperty(value = "管理员ID", example = "1", required = true)
    private Long managerId;

    @Data
    @ApiModel(description = "巡检项目")
    public static class InspectionItem {
        @NotBlank(message = "项目名称不能为空")
        @ApiModelProperty(value = "项目名称", example = "外观检查", required = true)
        private String name;

        @NotEmpty(message = "检查点不能为空")
        @ApiModelProperty(value = "检查点列表", example = "[\"外壳完整性\",\"标识清晰度\"]", required = true)
        private List<String> checkPoints;

        @NotBlank(message = "标准值不能为空")
        @ApiModelProperty(value = "标准值", example = "完好", required = true)
        private String standardValue;

        @ApiModelProperty(value = "单位", example = "")
        private String unit;
    }
} 